package com.spsy.order.controller.api;

import com.alibaba.fastjson2.JSON;
import com.spsy.common.core.domain.R;
import com.spsy.common.vo.NotifyOrderRequest;
import com.spsy.order.api.OrderApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * 支付系统实现类
 * @author: liuzhiping
 * @date: 2025/5/5 11:50
 **/
@RestController
@Slf4j
public class OrderApiController implements OrderApi {

    @Override
    public R notifyOrder(String orderId) throws Exception {

        log.info("收到支付系统回调的订单号 orderId:{}",orderId);

        Thread.sleep(3000);
        //orderId
        //修改订单系统的订单状态为成功
        return R.ok();
    }

    @Override
    public R notifyOrder(NotifyOrderRequest notifyOrderRequest) throws Exception {
        //2090383493249712025042787  orderStatus=2
        log.info("收到支付系统回调的订单号 orderId:{}", JSON.toJSONString(notifyOrderRequest));
        //orderId
        //修改订单系统的订单状态为成功
        //
        Thread.sleep(3000);


        return R.ok();
    }
}
